{ INFORMATICS.MCCME.RU
  Problem statement: http://informatics.mccme.ru/moodle/mod/statements/view3.php?chapterid=1421
  Verdict: Accepted
}
uses SysUtils, Math;
 
var
	i,ls:longint;
	s:string;
 
begin
reset(input,'input.txt');
rewrite(output,'output.txt');
readln(S);
i:=1;
ls:=length(s);
while i<ls do begin
	inc(i);
	if (s[i]=s[i-1]) and (s[i]=' ') then begin
		delete(s,i,1);
		ls:=length(s);
		dec(i);
	end;
end;
write(s);
end.